//
//  ViewController+Action.h
//  YouChi
//
//  Created by sam on 15/5/7.
//  Copyright (c) 2015年 Guangzhou QuicklyANT Information Technology Guangzhou QuicklyANT Information Technology Guangzhou QuicklyANT Information Technology Co.,LTD. All rights reserved.
//

typedef NS_OPTIONS(NSUInteger, ETabBarType) {
    kImageTitleType,
    kTitleImageType,
    kImageCenterType,
};

#import <UIKit/UIKit.h>
#import "BaseModel.h"
@interface UIViewController(Action);

/* 返回 */
- (IBAction)onReturn;
/* 返回最根控制器 */
-(void)toRetionRootViewController;


/* 弹下去 */
- (IBAction)onDismissReturn;
/* 弹下到最根控制器 */
-(void)toDismissRootViewController;

/* 模态 */
- (void)presentToVC:(UIViewController *)viewController;
//半透明
- (void)presentWindowToVC:(UIViewController *)vc Completion:(void (^ __nullable)(void))completion;
- (void)presentWindowToVC:(UIViewController *)vc IsNaV:(BOOL)isNav Completion:(void (^ __nullable)(void))completion;

/* 导航pust */
- (void)pushToVC:(UIViewController *)viewController;
- (void)pushToVC:(UIViewController *)viewController model:(id)model;
- (void)pushToVC:(UIViewController *)viewController model:(id)model hideTabBar:(BOOL)hide;

/* 移除导航控制器VC */
- (instancetype )removeNavigationController;

/**
 *  充导航栈中找到对应的控制器
 *
 *  @param name 要找控制器的名字
 *
 *  @return 对应的控制器
 */
-(UIViewController *)viewControllerForName:(NSString *)name;
@end




@interface UIViewController(nib)
/* 创建返回BarButtonItem */
- (UIBarButtonItem *)creatBackButton;
/* 创建返回按钮 */
- (void)onSetupBackButton;
@end



@interface UIViewController(Segue)
@property (nonatomic,weak) UIViewController *pushedViewController;
- (instancetype )removeNavigationController;
@end



@interface UIViewController (Add)
/**
 *  添加控件
 *
 *  @param view 控件
 */
-(void)addView:(id)view;

/** < uiViewController本身的View的属性 > */
//@property(nonatomic,strong)layoutBlock layoutBlock;

/** < 设置对象frame > */
-(void)onMainQueueAddSub:(layoutBlock)layoutBlock;

/** < 设置对象约束 > */
-(void)onMainAddSubConstraint:(constraintBlock)constraintBlock;

/** < 设置对象的更新方法 > */
-(void)onUpdateSubView:(loadAnimatedBlock)loadAnimatedBlock;



@end

@interface UIViewController (create)
/** < 获取当前屏幕所看到的viewController > */
- (UIViewController *)getAppRootViewController;
/** < model > */
@property (nonatomic,strong) BaseModel  *model;

@end

@interface UIViewController (login)

- (BOOL)gotoLoginPageIfNotLogin;

@end


@interface UIViewController (TabBar)
-(void)setTabBarItemType:(ETabBarType)type;
@end




